package com.hwl.eduservice.controller;

import com.hwl.commonutils.result.RespBean;
import com.hwl.eduservice.service.SubjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Api(tags = "课程分类")
@RestController
@RequestMapping("/api/eduSubject")
public class ApiSubjectController {

    @Resource
    private SubjectService subjectService;

    @ApiOperation("获取所有的课程分类")
    @GetMapping("nested-list")
    public RespBean nestedList() {
        return RespBean.ok().data(subjectService.nestedList());
    }
}
